</div>
<div class="span-7 last">
    <div class="sidebar">
        <!-- LOGIN Module -->
        <div class="sidebox">
            <?php
            if (isConnected ())
            {
                ?>
                Bonjour <?php echo $global_member->getPrenomUtilisateur(); ?> ,<br />
                Derni&egrave;re connexion : <?php echo date("d/m/Y, H:i",$global_member->getDateDerniereConn()); ?>
                <br />
                <a href="<?php echo URL; ?>index.php?m=logout">Deconnexion</a>
                <?php
            }
            else
            {
                switch ($err)
                {
                    case 1:
                        ?><p class="error">Probleme de login/mot de passe</p><?php
                    break;
                    case 4:
                        echo "Probleme lors de la recuperation de l'utilisateur";
                    break;
                    case 2:
                    case 3:
                    case 5:
                        echo "Une erreur est survenue.";
                    break;
                }

                $module = $_SERVER['QUERY_STRING'];
                ?>
                <form method="post" action="<?php echo URL; ?>index.php<?php if (isset($module)){ echo "?" . $module; } ?>" id="form-login">
                    <input type="text" name="proc_login" id="proc_login"
                        class="text" style="width:225px;"
                        value="Adresse e-mail"
                        onclick="if(this.value=='Adresse e-mail'){this.value ='';}"/><br />
                    <input type="password" name="proc_password" id="proc_password"
                        class="text" style="width:225px;"
                        value="mot de passe"
                        onclick="if(this.value=='mot de passe'){this.value ='';}"/><br /><br />
                    <a onclick="$('#form-login').submit();" class="button green" style="color:white;">Se connecter</a>
                </form>
            <?php } ?>
        </div>
        <!-- Module OFFRES RECENTES -->
        <?php if (isConnected () && (((isset($_GET['m']) && $_GET['m'] != "offres")) ||!isset($_GET['m']) )) { ?>
            <?php $lstOffre = Offre::getListPortailOffreDesc(20); ?>
            <div class="sidebox" id="newsticker-demo">
                <div><h2>Offres R&eacute;centes</h2></div>
                <div id="sidebarOffres">
                    <ul>
                    <?php foreach ($lstOffre as $v) { ?>
                        <li>
                            <div class="info">
                                <a href="<?php echo URL; ?>index.php?m=view_offre&id=<?php echo $v->IdOffre; ?>">
                                    <?php echo stripcslashes($v->TitreOffre); ?>
                                </a>
                                <span class="cat">
                                    <?php
                                    $offre = new Offre($v->IdOffre);
                                    $lstCategorie = $offre->getIdsCategorie();
                                    foreach ($lstCategorie as $c)
                                    {
                                        echo " <a href='#'>" . Categorie::getNomById($c) . "</a> |";
                                    }
                                    ?>
                                </span>
                            </div>
                            <div class="clear"></div>
                        </li>
                    <?php } ?>
                    </ul>
                </div>
            </div>
            <?php if (count($lstOffre) > 5)
            { ?>
                <script type="text/javascript">
                $("#sidebarOffres").jCarouselLite({
                    vertical: true,
                    mouseWheel: true,
                    visible: 5,
                    auto:1000,
                    speed:1000
                });
                </script>
            <?php } ?>
        <?php } ?>
        <!-- MODULE FILTRE POUR LISTING OFFRE -->
        <?php if(isConnected() && (isset($_GET['m']) && $_GET['m'] == "offres")){ ?>
            <div class="sidebox">
                <div><h2>Filtrer les Offres</h2></div>
                <form id="filtreOffre" class="niceform" action="<?php echo URL; ?>index.php?m=offres" method="post">
                    <div>
                        <h3>Promo</h3>
                        <?php
                        if(isset($_GET['promo']) && !empty($_GET['promo']))
                        {
                            $idpromo = (int)$_GET['promo'];
                        }
                        else
                        {
                            $idpromo = 0;
                        }
                        
                        $lstPromo = Promo::getListPromo();
                        foreach($lstPromo as $id=>$nom)
                        {

                            ?><input type="checkbox" <?php if($idpromo== $id){ echo 'checked="checked"'; }?> value="<?php echo $id; ?>" name="promo[]"><?php echo $nom; ?>&nbsp;|&nbsp;<?php
                        }
                        ?>
                    </div>
                    <div>
                        <h3>Cat&eacute;gories</h3>
                        <?php
                        $lstCategorie = Categorie::getListCategory();
                        foreach($lstCategorie as $c)
                        {
                            ?><input type="checkbox" value="<?php echo $c->IdCategorie; ?>" name="categories[]"><?php echo $c->NomCategorie; ?><br /><?php
                        }
                        ?>
                    </div>
                    <div>
                        <h3>Technologies</h3>
                        <?php
                        $lstTechno = Technologie::getList();
                        foreach($lstTechno as $t)
                        {
                            ?><input type="checkbox" value="<?php echo $t->idTechnologie; ?>" name="techno[]"><?php echo $t->NomTechnologie; ?><br /><?php
                        }
                        ?>
                    </div>
                    <div>
                        <h3>Domaines d'application</h3>
                        <?php
                        if(isset($_GET['dom']) && !empty($_GET['dom']))
                        {
                            $iddomaine = (int)$_GET['dom'];
                        }
                        else
                        {
                            $iddomaine = 0;
                        }
                        $lstDomaine = DomaineApplication::getList();
                        foreach($lstDomaine as $d)
                        {
                            ?><input type="checkbox" <?php if($iddomaine == $d->idDomaineApplication){ echo "checked='checked'"; }?> value="<?php echo $d->idDomaineApplication; ?>" name="domaine[]"><?php echo $d->NomDomaineApplication; ?><br /><?php
                        }
                        ?>
                    </div>
                    <div>
                        <input type="hidden" name="page" id="pageResult" value="1" />
                        <input type="button" id="searchOffre" name="submit" value="Rechercher" class="button green" />
                    </div>
                </form>
            </div>
        <?php } ?>
    </div>
</div>
</div>